package org.team4.web.ajax;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.team4.constants.StringConstant;
import org.team4.service.AttachedFileService;

import com.opensymphony.xwork2.Action;

@Controller
@Scope("prototype")
public class AttachedFileAjaxAction {

    @Autowired
    private AttachedFileService attachedFileService;

    private String attachedFileId;
    private String deleteSuccess;

    /** 删除附件 */
    public String deleteAttachedFile() throws Exception {
        attachedFileService.delete(attachedFileId);
        deleteSuccess = StringConstant.TRUE;
        return Action.SUCCESS;
    }

    public void setAttachedFileId(String attachedFileId) {
        this.attachedFileId = attachedFileId;
    }

    public String getDeleteSuccess() {
        return deleteSuccess;
    }
}